/*
 *  GuiTextBox.h
 *  SpaceTrader
 *
 *  Created by Jake on 10/7/12.
 *  Copyright 2012 __MyCompanyName__. All rights reserved.
 *
 */
#include "SpaceTrader.h"
#include "GuiTools.h"

enum textbox_state_t {CLICK, TYPE, OTHER};

class GuiTextBox
{
private:
	int x, y, ticks;
	std::string inputText;
	SDL_Surface *text;
    bool isFocused;
	
public:
	
	GuiTextBox(int xVal, int yVal);
	GuiTextBox(const GuiTextBox &G);
	~GuiTextBox();
    GuiTextBox& operator=(const GuiTextBox &G);
	
	std::string getText();
    
    void focus();
    
    void unFocus();
    
    void toggleFocus();
    
    bool hasFocus();
	
	textbox_state_t handle_input(SDL_Event event, TTF_Font *font, SDL_Color textColor);
	
	void show(SDL_Surface *screen);
};
	
